def call(){
	
	APP = "boot"
	ARTIFACT = "target/boot.jar"

	REGISTRY_URL = "abcsys.cn:5000/public"
	IMAGE_NAME = "${REGISTRY_URL}/${JOB_NAME}:${BUILD_NUMBER}"

	registry_catalog = "${REGISTRY_URL}"

	stage("scm"){
        git branch: "master", url: "https://gitee.com/mmbluex/boot.git"
	}

	stage('MavBuild'){ 
        docker.image('maven:3-jdk-8-alpine').inside('-v /root/.m2:/root/.m2') {
            sh 'pwd'
            sh 'java -version'
            sh 'mvn clean package -Dmaven.test.skip=true'
            sh '''
                ls -l
            '''
        }	    
	 }

    stage('推送镜像') {
        configFileProvider([configFile(fileId: 'Dockerfile', variable: 'DOCKER_FILE')]) {
            docker.withRegistry("http://${REGISTRY_URL}") {
                def app = docker.build("$IMAGE_NAME", "--no-cache --build-arg JAR_PATH=${ARTIFACT} --build-arg JAR_NAME=${APP} -f ${DOCKER_FILE} .")
                app.push()
            }
        }
    }

}